﻿Imports System.Data
Imports System.Data.Odbc
Imports WSEntidades
Public Class MovinvFact
    Public Shared Function Build(ByVal dr As OdbcDataReader) As MovinvBE
        Dim tmpMovinv As MovinvBE = New MovinvBE()
        Try
            With tmpMovinv
                .ALMACEN1 = convertDTFromDb.ConvertString(dr.Item("ALMACEN1"))
                .ALMACEN2 = convertDTFromDb.ConvertString(dr.Item("ALMACEN2"))
                .Cantidad = convertDTFromDb.ConvertDecimal(dr.Item("Cantidad"))
                .Concepto = convertDTFromDb.ConvertString(dr.Item("Concepto"))
                .Costo = convertDTFromDb.ConvertDecimal(dr.Item("Costo"))
                .Estatus = convertDTFromDb.ConvertString(dr.Item("Estatus"))
                .Fecha = convertDTFromDb.convertDateTime(dr.Item("Fecha"))
                .FechaMov = convertDTFromDb.convertDateTime(dr.Item("FechaMov"))
                .FolioE = convertDTFromDb.ConvertString(dr.Item("FolioE"))
                .IdEmpresa = convertDTFromDb.ConvertShort(dr.Item("IdEmpresa"))
                .Nombre = convertDTFromDb.ConvertString(dr.Item("Nombre"))
                .NumEnt = convertDTFromDb.ConvertString(dr.Item("NumEnt"))
                .NumFactura = convertDTFromDb.ConvertString(dr.Item("NumFactura"))
                .Precio = convertDTFromDb.ConvertDecimal(dr.Item("Precio"))
                .Proveedor = convertDTFromDb.ConvertString(dr.Item("Proveedor"))
                .Tipo = convertDTFromDb.ConvertString(dr.Item("Tipo"))
                .TipoMov = convertDTFromDb.ConvertString(dr.Item("TipoMov"))
            End With
            Return tmpMovinv
        Catch ex As Exception
            Throw
        Finally
            tmpMovinv = Nothing
        End Try
    End Function
End Class
